//
//  HistoryEntryCell.m
//  WOPrototype
//
//  Created by Olof Millberg on 2010-04-21.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "HistoryEntryCell.h"


@implementation HistoryEntryCell
@synthesize nameLabel;
@synthesize dateLabel;
@synthesize textLabel;
@synthesize imageView;
@synthesize background;
@synthesize entryType;

- (void) setEntryType:(NSInteger)anEntryType
{
	entryType = anEntryType;
	
	switch (entryType) {
		case 0:
			imageView.image = [UIImage imageNamed:@"icon_note.png"];
			break;
		case 1:
			imageView.image = [UIImage imageNamed:@"icon_specification.png"];
			break;
		default:
			break;
	}
}

- (void) setSelected:(BOOL)isSelected animated:(BOOL)animated
{
	//	if (animated)
	//	{
	//		[UIView beginAnimations:nil context:nil];
	//		[UIView setAnimationDuration:0.4];
	//	}
	
	[super setSelected:isSelected animated:animated];
	if (isSelected)
		background.image = [UIImage imageNamed:@"cell_selected.png"];
	else
		background.image = [UIImage imageNamed:@"cell_neutral.png"];
	
	//	if (animated)
	//		[UIView commitAnimations];
}

@end
